//
//  BBHintedBlobDetector.h
//  BBTouch
//
//  Created by ben smith on 8/7/08.
//  This file is part of BBTouch.
//
//  BBTouch is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.

//  BBTouch is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Lesser General Public License for more details.

//  You should have received a copy of the GNU Lesser General Public License
//  along with BBTouch.  If not, see <http://www.gnu.org/licenses/>.
// 
//  Copyright 2008 Ben Britten Smith ben@benbritten.com .
//

#import <Cocoa/Cocoa.h>

// extends the original blob detector by adding a thresholding hint map
// this is basically a copy of the background image but instead of pixel values it gives 
// weighted threshold values.
// the single adjustable threshold controls the maximum threshold number
// and that is adjusted in the hint map based on the background pixel value
// ie in darker areas the threshold is lower.

//NOTE: this is not tested
// NOTE2: this is pretty much obsoleted with the introduction of the filtered detector, plus i never got it to work right anyhow

#import "BBBlobDetector.h"

@interface BBHintedBlobDetector : BBBlobDetector {
	NSImage * thresholdMapImage;
	unsigned char *thresholdBytes;
	BOOL useHints;
}

@property (copy) NSImage * thresholdMapImage;
@property (assign) BOOL useHints;

- (BOOL)_contour;
- (BOOL)_validBlobPixel:(int)position;
- (id) init;
- (void)_handleGoodPixel
;
- (void)_scanSrcDataWithROI;
- (void)calculateThresholdMap;
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context;
- (void)setBgImage:(NSImage*)anImage;

// 8 methods



@end
